using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using SiteECSWeb;

public partial class Authorities_AddAuhorties : PageBase
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            #region SiteMap
            this.SiteMapNodeProvider = SiteMapProviderNames.ListMXmlSiteMapProvider.ToString();
            SiteMapPath1.SiteMapProvider = SiteMapNodeProvider;
            #endregion
        }
    }
    protected void lbtnAdd_Click(object sender, EventArgs e)
    {
        if (!IsPageRefresh)
        {
            AuthoritiesBLL authAPI = new AuthoritiesBLL();
            int AuthID = authAPI.AddAuthorty(txt_AuthNameAr.TextBoxData,
                txt_AuthAddressAr.TextBoxData, txt_AuthNameEn.TextBoxData, txt_AuthAddressEn.TextBoxData,
                txt_AuthPhone.TextBoxData, txt_AuthPhone2.TextBoxData, txt_AuthFax.TextBoxData,
                txt_AuthFax2.TextBoxData, txt_AuthEmail.TextBoxData, txt_AuthWsite.TextBoxData,
                int.Parse(ddlAuthTypes.SelectedItem.Value), 2175);

            if (AuthID != -1)
            {
                lbl_AuthAddressAr.Text = txt_AuthAddressAr.TextBoxData;
                lbl_AuthAddressEn.Text = txt_AuthNameEn.TextBoxData;
                lbl_AuthEmail.Text = txt_AuthEmail.TextBoxData;
                lbl_AuthFax.Text = txt_AuthFax.TextBoxData;
                lbl_AuthFax2.Text = txt_AuthFax2.TextBoxData;
                lbl_AuthNameAr.Text = txt_AuthNameAr.TextBoxData;
                lbl_AuthNameEn.Text = txt_AuthNameEn.TextBoxData;
                lbl_AuthPhone2.Text = txt_AuthPhone2.TextBoxData;
                lbl_AuthTypes.Text = ddlAuthTypes.SelectedItem.Text;
                lbl_AuthWsite.Text = txt_AuthWsite.TextBoxData;
                lbl_txt_AuthPhone.Text = txt_AuthPhone.TextBoxData;

                lnkEdit.NavigateUrl = Helper.NavURLParamsIntVirtualName(AuthID,
                    Globals.Settings.VirtualNamesInfo.AuthorEdit);
                //lnkReport.NavigateUrl = Helper.NavURLParamsIntVirtualName(TrdaffSubID,
                //    Globals.Settings.VirtualNamesInfo.TradAffectSubReport);

                MultiView1.ActiveViewIndex += 1;
            }
            TrackRefreshState();
        }
        TrackRefreshState();
    }
}
